import request from './index'
export interface INF_HomeViews_info {
  Id: string
  Price: number
  TelCode: string
  Building: string
  Floor: number
  NightFlag: boolean
  UseFlag: number
  YuLi: string
  TheClass: string
  TheClassId: number
  LastUpdate: string
  LastStatus: string
  Note: null
  Md5: string
  ReceiveView?: {
    BookType: number
    Room: string
    Price: number
    ReceiveId: string
    TeamName: null
    ManName: string
    Yj: number
    Xf: number
    Ysq: number
    ManNum: number
    CheckIn: string
    CheckOut: string
    ManClass: string
    ReceiveClass: string
    LinkId: string
    Secret: boolean
    Master: boolean
    BookId: string
    BookMan: string
    Notice: string
    Md5: string
  }
  BookView?: {
    BookId: string
    Room: string
    BookName: string
    BookTel: string
    Price: number
    Md5: string
    TheClass: string
  }
  IsLinks: boolean
  BookType: string
}

export interface INF_Summary {
  TotalHomes: number
  TodayLeave: number
  AvgPrice: number
  Rate: number
  Rp: number
  TodayReceive: number
  TodayBookedNoneCheckIn: number
  LinkAccounts: any
  UnNight: number
  SumPrice: number
  Xuzhu: number
}

export interface INF_ViewsV2_res {
  HomeViews: Array<INF_HomeViews_info>
  Summary: INF_Summary
}

// 锁房
export interface INF_Lock {
  EndTime: string
  Reason: string
  RoomNo: string
  StartTime: string
}

// 获取房态图与在住信息
export function ViewsV2() {
  return request({
    url: '/Home/ViewsV2'
  })
}

// 锁房
export function Lock(data: { Data: { Value: INF_Lock } }) {
  return request({
    url: '/Home/Lock',
    method: 'post',
    data
  })
}
